{
  "openapi": "3.0.1",
  "info": {
    "title": "Planning Certificate 10.7 - ePlanning to Council",
    "description": "# Authentication    \n\nPlease use the subscription key provided by the Department to access the APIs.\n",
    "contact": {},
    "version": "v1"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/CreatePlanningCertificate/{CaseID}": {
      "post": {
        "summary": "CreatePlanningCertificate",
        "description": "This operation transfers Planning Certificate requests from the Online Section 10.7 Planning Certificate Service into the council IT system.",
        "operationId": "post-create10.7-caseid",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Planning Certificate 10.7 case",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The council LGA name or Private Certifier Organisation name to indicate where the response is routed to.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Create10.7"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Planning Certificate case already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "applicable field values not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    },
    "/UpdatePlanningCertificate/{CaseID}": {
      "put": {
        "summary": "UpdatePlanningCertificate",
        "description": "This operation transfers Planning Certificate requests from the Online Section 10.7 Planning Certificate Service into the council IT system.In this opeartion Council can edit 10.7 Planning Certificate application details",
        "operationId": "put-update10.7-caseid",
        "parameters": [
          {
            "name": "CaseID",
            "in": "path",
            "description": "A fully qualified Planning Certificate 10.7 case",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrganisationID",
            "in": "header",
            "description": "The council LGA name or Private Certifier Organisation name to indicate where the response is routed to.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "Information request object",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Update10.7"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {}
          },
          "400": {
            "description": "Invalid request supplied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Planning Certificate case already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "applicable field values not provided",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "Location": {
        "title": "Location",
        "required": [
          "address",
          "lga"
        ],
        "type": "object",
        "properties": {
          "address": {
            "maxLength": 250,
            "type": "string",
            "description": "Address where the development is happening",
            "example": "19-33 Elizabeth Street, Narrandera, 2700"
          },
          "addressDetail": {
            "$ref": "#/components/schemas/AddressDetail"
          },
          "lotsectionplan": {
            "type": "string",
            "example": "1/-/SPXXXXX"
          },
          "lga": {
            "maxLength": 30,
            "type": "string",
            "description": "Local Government Area under which this case falls",
            "example": "PENRITH"
          }
        }
      },
      "AddressDetail": {
        "required": [
          "latitude",
          "longitude",
          "postCode",
          "state",
          "streetName",
          "suburb"
        ],
        "type": "object",
        "properties": {
          "complexUnitType": {
            "type": "string"
          },
          "complexLevelType": {
            "type": "string"
          },
          "complexLevelNumber": {
            "type": "string"
          },
          "complexUnitIdentifier": {
            "type": "string"
          },
          "streetNumber1": {
            "type": "string"
          },
          "streetNumber2": {
            "type": "string"
          },
          "streetName": {
            "type": "string"
          },
          "streetSuffix": {
            "type": "string"
          },
          "streetType": {
            "type": "string"
          },
          "suburb": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "wkid": {
            "type": "string"
          },
          "cadastralID": {
            "type": "string"
          },
          "primarySecondary": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "postCode": {
            "type": "number"
          }
        }
      },
      "Person": {
        "title": "Person",
        "required": [
          "address",
          "email",
          "familyName",
          "firstName"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "maxLength": 20,
            "type": "string"
          },
          "otherName": {
            "maxLength": 20,
            "type": "string"
          },
          "familyName": {
            "maxLength": 20,
            "type": "string"
          },
          "contactNumber": {
            "maxLength": 10,
            "minLength": 8,
            "pattern": "^[0-9]+$",
            "type": "string"
          },
          "email": {
            "maxLength": 250,
            "type": "string"
          },
          "address": {
            "maxLength": 250,
            "type": "string",
            "description": "Required as a part of Applicant details"
          }
        }
      },
      "Error": {
        "title": "Error",
        "required": [
          "errorCode",
          "statusCode"
        ],
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "example": 404
          },
          "message": {
            "type": "string",
            "example": "Internal Server error 19876"
          },
          "activityId": {
            "type": "string",
            "example": "00000011-0ab-xy00-0000-500000000000"
          },
          "errorCode": {
            "type": "string",
            "example": "DPE_TMS01"
          },
          "errorDetails": {
            "type": "string",
            "example": "Inner Exceptions, Stack Trace, etc"
          }
        }
      },
      "PersonBody": {
        "title": "PersonBody",
        "required": [
          "firstName",
          "familyName",
          "email",
          "contactNumber"
        ],
        "type": "object",
        "properties": {
          "firstName": {
            "maxLength": 20,
            "type": "string",
            "example": "John"
          },
          "familyName": {
            "maxLength": 20,
            "type": "string",
            "example": "Smith"
          },
          "email": {
            "maxLength": 250,
            "type": "string",
            "description": "User must be registered in the planning portal",
            "example": "john.smith@gmail.com"
          },
          "contactNumber": {
            "maxLength": 10,
            "minLength": 8,
            "pattern": "^[0-9]+$",
            "type": "string"
          }
        }
      },
      "DownloadableDocument": {
        "title": "DownloadableDocument",
        "required": [
          "documentName",
          "documentType",
          "documentURL",
          "uploadedDateTime"
        ],
        "type": "object",
        "properties": {
          "documentName": {
            "maxLength": 150,
            "type": "string",
            "description": "documentName has to be appended with file extension",
            "example": "test.docx"
          },
          "documentType": {
            "maxLength": 100,
            "type": "string"
          },
          "uploadedDateTime": {
            "type": "string",
            "format": "date-time"
          },
          "documentURL": {
            "maxLength": 500,
            "type": "string",
            "description": "URL of the document to be downloaded"
          },
          "documentSize": {
            "description": "This indicates the file size of the document in bytes",
            "type": "number"
          },
          "updatedBy": {
            "type": "string",
            "example": "Council"
          }
        }
      },
      "updatedBy": {
        "title": "updatedBy",
        "type": "object",
        "properties": {
          "person": {
            "$ref": "#/components/schemas/PersonBody"
          }
        }
      },
      "declaration10.7": {
        "title": "declaration10.7",
        "type": "string",
        "description": "Holds the declarations the users is supposed to provide on submitting the application. One of the below mentioned values must be selected for declaration10.7 1. I declare that all the information in my application and accompanying documents is to the best of my knowledge, true and correct. 2. I understand that if incomplete, the consent authority may request more information, which will result in delays to the application. 3. I acknowledge that copies of this application and supporting documentation may be provided to interested persons in accordance with the Government Information (Public Access) 2009 (NSW) (GIPA Act). 4. I have read and agree to the collection and use of my personal information as outlined in the Privacy Notice",
        "example": "Refer to description for values"
      },
      "applicantList": {
        "type": "object",
        "required": [
          "applyOnBehalfOfCompany"
        ],
        "properties": {
          "applyOnBehalfOfCompany": {
            "type": "boolean",
            "description": "This property will hold whether the applicant is company or Not. If YES need to provide the company details."
          },
          "contactDetails": {
            "$ref": "#/components/schemas/applicantDetails"
          },
          "isManualEntry": {
            "type": "boolean",
            "description": "Used to hold manual entry flag for Business API search ABN/ACN"
          },
          "applicantCompany": {
            "$ref": "#/components/schemas/applicantCompany"
          }
        },
        "description": "used to hold owner’s Corporation details."
      },
      "Create10.7": {
        "title": "Create10.7",
        "required": [
          "caseStatus",
          "siteAddress",
          "certificateTypeApplied",
          "payerInformation",
          "declarations"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "maxLength": 80,
            "type": "string",
            "description": "Status of the Planning Certificate case",
            "example": "Submitted"
          },
          "certificateType": {
            "type": "string",
            "example": "Planning Certificate 10.7"
          },
          "primaryApplicant": {
            "$ref": "#/components/schemas/applicantList"
          },
          "secondaryApplicants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/applicantList"
            }
          },
          "certificateTypeApplied": {
            "$ref": "#/components/schemas/CertificateType"
          },
          "siteAddress": {
            "$ref": "#/components/schemas/Location"
          },
          "payerInformation": {
            "type": "object",
            "properties": {
              "isPayerCompany": {
                "$ref": "#/components/schemas/isPayerCompany"
              },
              "payerPerson": {
                "$ref": "#/components/schemas/payerPerson"
              },
              "isManualEntry": {
                "type": "boolean",
                "description": "Used to hold manual entry flag for Business API search ABN/ACN"
              },
              "payerCompany": {
                "$ref": "#/components/schemas/payerCompany"
              }
            }
          },
          "declarations": {
            "type": "array",
            "description": "Required applicant declaration for planning certificate 10.7",
            "items": {
              "$ref": "#/components/schemas/declaration10.7"
            }
          },
          "isResend": {
            "type": "boolean",
            "description": "This is to track if application details are resent. True indicates a retriggered event."
          },
          "documents": {
            "type": "object"
          },
          "updatedBy": {
            "$ref": "#/components/schemas/updatedBy"
          }
        }
      },
      "Update10.7": {
        "title": "Create10.7",
        "required": [
          "caseStatus",
          "siteAddress",
          "certificateTypeApplied",
          "payerInformation",
          "declarations"
        ],
        "type": "object",
        "properties": {
          "caseStatus": {
            "maxLength": 80,
            "type": "string",
            "description": "Status of the Planning Certificate case",
            "example": "Submitted"
          },
          "certificateType": {
            "type": "string",
            "example": "Planning Certificate 10.7"
          },
          "primaryApplicant": {
            "$ref": "#/components/schemas/applicantList"
          },
          "secondaryApplicants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/applicantList"
            }
          },
          "certificateTypeApplied": {
            "$ref": "#/components/schemas/CertificateType"
          },
          "siteAddress": {
            "$ref": "#/components/schemas/Location"
          },
          "payerInformation": {
            "type": "object",
            "properties": {
              "isPayerCompany": {
                "$ref": "#/components/schemas/isPayerCompany"
              },
              "payerPerson": {
                "$ref": "#/components/schemas/payerPerson"
              },
              "isManualEntry": {
                "type": "boolean",
                "description": "Used to hold manual entry flag for Business API search ABN/ACN"
              },
              "payerCompany": {
                "$ref": "#/components/schemas/payerCompany"
              }
            }
          },
          "declarations": {
            "type": "array",
            "description": "Required applicant declaration for planning certificate 10.7",
            "items": {
              "$ref": "#/components/schemas/declaration10.7"
            }
          },
          "deltaDocuments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedBy": {
            "$ref": "#/components/schemas/updatedBy"
          }
        }
      },
      "applicantDetails": {
        "title": "applicantDetails",
        "type": "object",
        "properties": {
          "title": {
            "$ref": "#/components/schemas/Title"
          },
          "person": {
            "$ref": "#/components/schemas/Person"
          }
        }
      },
      "applicantCompany": {
        "title": "applicantCompany",
        "type": "object",
        "properties": {
          "companyName": {
            "maxLength": 150,
            "type": "string",
            "description": "If applicant a company, provide the company name"
          },
          "ABN": {
            "type": "string",
            "description": "it should be 11-digit number",
            "example": "12 121 567 891"
          },
          "ACN": {
            "type": "string",
            "description": "it should be 9-digit number",
            "example": "123 456 789"
          },
          "tradingName": {
            "maxLength": 256,
            "type": "string",
            "description": "Name of the trading"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          }
        },
        "description": "If Apply on Behalf of Company is selected as 'Yes'"
      },
      "payerPerson": {
        "title": "payerPerson",
        "type": "object",
        "properties": {
          "title": {
            "$ref": "#/components/schemas/Title"
          },
          "payerInfo": {
            "$ref": "#/components/schemas/Person"
          }
        },
        "description": "Required if Payer Type selected as 'Individual'."
      },
      "payerCompany": {
        "$ref": "#/components/schemas/applicantCompany"
      },
      "CertificateType": {
        "title": "CertificateType",
        "type": "string",
        "description": "It infers the certificate type. One of the below mentioned values must be selected for CertificateType 1. S10.7 (2) 2. S10.7 (2 & 5)",
        "example": "Refer to description for values"
      },
      "isPayerCompany": {
        "type": "boolean",
        "description": "To differentiate whether the payer is a company or an individual."
      },
      "Title": {
        "title": "Title",
        "type": "string",
        "description": "It infers the salutation. One of the below mentioned values must be selected for Title 1. Miss 2. Mr 3. Mrs 4. Ms",
        "example": "Refer to description for values"
      },
      "ReqAddInfo": {
        "required": [
          "requestDetails",
          "updatedBy"
        ],
        "type": "object",
        "properties": {
          "childCaseID": {
            "type": "string",
            "description": "Used to hold the child case ID to perform RFI.",
            "example": "AI-XXXX"
          },
          "primaryCaseID": {
            "type": "string",
            "description": "Used to hold Planning Certificate case ID.",
            "example": "PC10.7-XXXX-XXX"
          },
          "caseStatus": {
            "type": "string",
            "description": "Used to hold the case status of Planning Certificate 10.7"
          },
          "requestDate": {
            "type": "string",
            "description": "Date and time of request",
            "format": "date"
          },
          "requestDetails": {
            "maxLength": 512,
            "type": "string",
            "description": "Short description of request"
          },
          "Documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DownloadableDocument"
            }
          },
          "updatedBy": {
            "$ref": "#/components/schemas/PersonBody"
          }
        }
      },
      "address": {
        "type": "object",
        "properties": {
          "address": {
            "maxLength": 250,
            "type": "string"
          },
          "email": {
            "maxLength": 250,
            "type": "string",
            "description": "Holds the email address",
            "format": "email"
          }
        },
        "description": "this object will hold the address  details"
      }
    }
  }
}